// Log.h: interface for the CLog class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LOG_H__DD4D8A0C_9679_48DA_9485_A066D1CECA7C__INCLUDED_)
#define AFX_LOG_H__DD4D8A0C_9679_48DA_9485_A066D1CECA7C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Guard.h"

class CLog
{
public:
	bool Err( CString sErrStr) const;
	bool Log( CString sLogStr);
	bool WriteDataToFile( CString sDataStr );
	bool CLog::WriteDataToFile(CString sFileName, CString sDataStr, bool bCreate) const;
	CLog();
	CLog(CString sPre);

	static CLog * Instance();
	static void DeleteInstance();

	virtual ~CLog();

protected:
	CString sFileName_;

private:
	static CLog * m_pInstance;
	long lTime_;
	bool bCreate_;
	CString sPre_;
	CMutex m_mutexLog;
	const long lErrTime_;
	const bool bErrCreate_;
};

#endif // !defined(AFX_LOG_H__DD4D8A0C_9679_48DA_9485_A066D1CECA7C__INCLUDED_)
